package io.hilo.example.biz01.web.demo;

import org.hilo.boot.app.web.AbstractController;
import org.hilo.boot.core.UT;
import org.jretty.apibase.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * 系统菜单
 */
@RestController
@RequestMapping("/sys/menu")
public class MenuController extends AbstractController {

    /**
     * 所有菜单列表
     */
    @RequestMapping("/list")
    public Result<?> list(
            @RequestParam(required = false) String sidx, 
            @RequestParam(required = false) String order,
            @RequestParam("page") int pageNum, 
            @RequestParam("limit") int pageSize) {

        if (UT.Str.isBlank(sidx)) {
            sidx = "type_";
        }
        if (UT.Str.isBlank(order)) {
            order = "asc";
        }
        // 查询列表数据
        // PagerData<MenuEntity> list = service.selectByPage(pageNum, pageSize,
        // UT.newMap("sidx", sidx).add("order", order));

        return Result.success("list");
    }

}
